package com.bl.weilan.service.biz.manager.admin.impl;

import com.bl.weilan.common.utils.ListUtils;
import com.bl.weilan.dao.model.AdminEntity;
import com.bl.weilan.dao.repository.AdminRepository;
import com.bl.weilan.service.biz.manager.admin.AdminService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yujingyi on 2018/1/24.
 */
@Service
@Transactional
@Log4j2
public class AdminServiceImpl implements AdminService {

    @Autowired
    AdminRepository adminRepository;

    @Override
    public AdminEntity getAdminByAccount(String account) {
        List<AdminEntity> list = adminRepository.findByAccount(account);
        return ListUtils.getFirst(list);
    }
}
